home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
c't freeware shareware 2001 January
/
CT_SW0101.ISO
/
pc
/
software
/
office
/
datenbk
/
valentin.sit
/
Valentina_PPC
/
more examples
/
Example for OpenForm
/
VSearch
< prev
next >
Wrap
Text File
|
1999-09-08
|
1KB
|
30 lines
set HTMLThanksHeader to "<html><head><title>Result page</title></head><body><br>"
set HTMLErrorHeader to "<html><head><title>Error</title></head><body><br>"
set HTMLfooter to "<br><br><br><hr></body></html>"
set FormatStr to "<BR><B>Name: </B>%<BR> <B>Company: </B>%<BR><B>E-mail: </B>%<BR><B>Comment: </B>%<BR><BR><HR>"
try
tell application "Valentina (PPC)"
set theFile to choose file with prompt "Choose database file" of type {"Vdsc"}
set DB to open theFile
tell base object "Guests" of DB
set ResultSet to select records where {field "Name", "aaa"}
set theCount to count of records in ResultSet
set result to format data {field "Name", field "Company", field "Email", field "Comment"} from 1 to theCount selection ResultSet using FormatStr
set result to format data {field "Letter"} from 1 to 1 selection ResultSet using "%" with text to HTML
end tell
end tell
return HTMLThanksHeader & "<H2>Search result:</H2><P> " & result & " <HR><HR>" & HTMLfooter
-- if there is an error, notify the user
on error
return HTMLErrorHeader & "<H2>Error processing this script</H2>" & HTMLfooter
end try